package com.example.demo.service.impl;

import com.example.demo.entity.EmployeeEntity;
import com.example.demo.mapper.EmployeeSCXMapper;
import com.example.demo.service.EmployeeSCXService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class EmployeeSCXServiceImpl implements EmployeeSCXService {

	@Resource
	EmployeeSCXMapper employeeSCXMapper;

	/**
	 * ログイン
	 * 
	 * @param name,code,password
	 * @return LoginResponseDto
	 */
	@Override
	public EmployeeEntity select(String name, String code, String password) {

		// 社員情報を取得する
		List<EmployeeEntity> employList = employeeSCXMapper.select(name, code, password);

		// 検索結果判定
		if (employList != null & employList.size() == 1)
			return employList.get(0);

		return new EmployeeEntity();
	}
}
